import request from '../utils/request'

//获取设备列表
export function deviceList(data) {
  return request({
    url: '/device/getList',
    method: 'post',
    data
  })
}

//上传图片
export function uploadFile(data) {
    const formData = new FormData()
    formData.append('file', data.raw)
    return request({
        url: '/base/upload_file',
        method: 'post',
        data: formData
    })
}

//设备编辑
export function deviceEdit(data) {
    return request({
        url: '/device/edit',
        method: 'post',
        data
    })
}

//设备删除
export function deviceDel(data) {
    return request({
        url: '/device/del',
        method: 'post',
        data
    })
}

//批量解绑
export function releaseBatch(data) {
    return request({
        url: '/device/releaseBatch',
        method: 'post',
        data
    })
}

//设备状态看板
export function statusDashboard(data) {
    return request({
        url: '/device/statusDashboard',
        method: 'post',
        data
    })
}

//设备状态记录
export function statusLog(data) {
    return request({
        url: '/device/statusLog',
        method: 'post',
        data
    })
}

//设备开机率看板
export function rateDashboard(data) {
    return request({
        url: '/device/startupRateDashboard',
        method: 'post',
        data
    })
}

//计数看板
export function countDashboard(data) {
    return request({
        url: '/device/countDashboard',
        method: 'post',
        data
    })
}

//计数报表
export function countReport(data) {
    return request({
        url: '/device/countReport',
        method: 'post',
        data
    })
}

//小时计数报表
export function hourCountReport(data) {
    return request({
        url: '/device/hourCountReport',
        method: 'post',
        data
    })
}

//计数明细
export function countList(data) {
    return request({
        url: '/device/countList',
        method: 'post',
        data
    })
}

//计数看板设备条件缓存
export function cacheCountCondition(data) {
    return request({
        url: '/device/cacheCountCondition',
        method: 'post',
        data
    })
}
//计数报表导出
export function exportCountReport(data) {
    return request({
        responseType: 'blob',
        url: '/device/exportCountReport',
        method: 'post',
        data
    })
}
//计数明细导出
export function exportCountList(data) {
    return request({
        responseType: 'blob',
        url: '/device/exportCountList',
        method: 'post',
        data
    })
}
